<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>支付页面</title>
    <script th:src="@{https://cdn.bootcdn.net/ajax/libs/qrcodejs/1.0.0/qrcode.js}"></script>
    <script th:src="@{https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js}"></script>
</head>

<body>
    <center>
        <div id="qrcode"></div>

    </center>
</body>
<script th:inline="javascript">
    var results = [[${map}]];
    var parse = JSON.parse(results);
    new QRCode(document.getElementById("qrcode"), parse.codeUrl);  // 设置要生成二维码的链接

    let timer =self.setInterval("querystatus()",3000);

    function querystatus() {
        $.get(`/api/wx/queryOrder/${parse.orderId}`,function(data,status){
            if (data==="支付中"){
                console.log("支付中");
            } else {
                clearInterval(int)
                window.location.href="/api/wx/success"
            }
        })
    }
</script>





</html>